educational

Surfer Redirection Using JavaScript

Using JavaScript to redirect visitors to your site to pages that are optimized for them has many benefits, and enables you to provide the most enhanced surfing experience possible. Here are a few of the scripts that I employ to make this process possible:

JavaScript Redirect
This code allows you to automatically redirect JavaScript enabled browsers to one page, while displaying a text link and / or message to non-JavaScript enabled browsers. This is especially useful if you (as I do) like to employ "gee-whiz" JS-based nav systems, or even a mundane "drop-down" box navigation, since you can easily filter non-JS users to your pages that use text-link or graphical button "only" based nav system:

<SCRIPT LANGUAGE="JavaScript">
<!-- JavaScript Redirect
window.location="https://www.yoursite.com/js_url.html";
// JavaScript Redirect -->
</SCRIPT>
<NOSCRIPT>
Your browser either does not support JavaScript, or you have it disabled. Click <A href="https://www.yoursite.com/no-js_url.html">Here</A> to Continue.
</NOSCRIPT>

Browser Redirect
If you build different pages for MS Internet Explorer and Netscape Navigator, you can use this script to send visitors to the correct browser-optimized page. While I do not personally build entire sites tailored for a specific browser, I will tailor the navigational components of a frames-based site to enable the "happiness" that the use of MSIE allows, for example, sending surfers to either "frameset-ie.shtml" or "frameset-ns.shtml" as the case may be:

<SCRIPT LANGUAGE="JavaScript">
<!-- Browser Redirect
if (navigator.appName.indexOf("Explorer") != -1){
window.location = "https://www.yoursite.com/ie_url.html";}
if (navigator.appName.indexOf("Netscape") != -1){
window.location = "https://www.yoursite.com/ns_url.html";}
// Browser Redirect -->
</SCRIPT>

Screen Resolution Redirect
This lets you redirect your visitors with 640x480 displays to one page, 800x600 to another, etc. Just as I do not (really) build different sites for different browsers, I do not (really) build different sites for different screen resoultions – but I may build sites that will be encapsulated into a new frameset if the user has a high screen resolution. This lets me use better navigation, and provides increased advertising opportunities. Here's the script:

<SCRIPT LANGUAGE="JavaScript">
<!-- Screen Resolution Redirect
if ((navigator.appVersion.indexOf("4.") != -1) && (navigator.appName.indexOf("Netscape") != -1) || (navigator.appVersion.indexOf("4.") != -1) && (navigator.appName.indexOf("Explorer") != -1)){ size = screen.width + "x" + screen.height; if (size == "640x480"){ top.location = "https://www.yoursite.com/640x480.html"; } }
// Screen Resolution Redirect -->
</SCRIPT>

As you can see, there are many benefits to redirecting surfers to pages tailored specifically for them, and using a few simple JavaScripts – rather than making them select options through a series of text links, is the way to go. Try a few of these out on your site, and stay tuned for more!

Copyright © 2025 Adnet Media. All Rights Reserved. XBIZ is a trademark of Adnet Media.
Reproduction in whole or in part in any form or medium without express written permission is prohibited.

More Articles

opinion

WIA Profile: Lainie Speiser

With her fiery red hair and a laugh that practically hugs you, Lainie Speiser is impossible to miss. Having repped some of adult’s biggest stars during her 30-plus years in the business, the veteran publicist is also a treasure trove of tales dating back to the days when print was king and social media not even a glimmer in the industry’s eye.

Women in Adult ·
opinion

Fighting Back Against AI-Fueled Fake Takedown Notices

The digital landscape is increasingly being shaped by artificial intelligence, and while AI offers immense potential, it’s also being weaponized. One disturbing trend that directly impacts adult businesses is AI-powered “DMCA takedown services” generating a flood of fraudulent Digital Millennium Copyright Act (DMCA) notices.

Corey D. Silverstein ·
opinion

Building Seamless Checkout Flows for High-Risk Merchants

For high-risk merchants such as adult businesses, crypto payments are no longer just a backup plan — they’re fast becoming a first choice. More and more businesses are embracing Bitcoin and other digital currencies for consumer transactions.

Jonathan Corona ·
opinion

What the New SCOTUS Ruling Means for AV Laws and Free Speech

On June 27, 2025, the United States Supreme Court handed down its landmark decision in Free Speech Coalition v. Paxton, upholding Texas’ age verification law in the face of a constitutional challenge and setting a new precedent that bolsters similar laws around the country.

Lawrence G. Walters ·
opinion

What You Need to Know Before Relocating Your Adult Business Abroad

Over the last several months, a noticeable trend has emerged: several of our U.S.-based merchants have decided to “pick up shop” and relocate to European countries. On the surface, this sounds idyllic. I imagine some of my favorite clients sipping coffee or wine at sidewalk cafés, embracing a slower pace of life.

Cathy Beardsley ·
profile

WIA Profile: Salima

When Salima first entered the adult space in her mid-20s, becoming a power player wasn’t even on her radar. She was simply looking to learn. Over the years, however, her instinct for strategy, trust in her teams and commitment to creator-first innovation led her from the trade show floor to the executive suite.

Women in Adult ·
opinion

How the Interstate Obscenity Definition Act Could Impact Adult Businesses

Congress is considering a bill that would change the well-settled definition of obscenity and create extensive new risks for the adult industry. The Interstate Obscenity Definition Act, introduced by Sen. Mike Lee, makes a mockery of the First Amendment and should be roundly rejected.

Lawrence G. Walters ·
opinion

What US Sites Need to Know About UK's Online Safety Act

In a high-risk space like the adult industry, overlooking or ignoring ever-changing rules and regulations can cost you dearly. In the United Kingdom, significant change has now arrived in the form of the Online Safety Act — and failure to comply with its requirements could cost merchants millions of dollars in fines.

Cathy Beardsley ·
opinion

Understanding the MATCH List and How to Avoid Getting Blacklisted

Business is booming, sales are steady and your customer base is growing. Everything seems to be running smoothly — until suddenly, Stripe pulls the plug. With one cold, automated email, your payment processing is shut down. No warning, no explanation.

Jonathan Corona ·
profile

WIA Profile: Leah Koons

If you’ve been to an industry event lately, odds are you’ve heard Leah Koons even before you’ve seen her. As Fansly’s director of marketing, Koons helps steer one of the fastest-growing creator platforms on the web.

Women in Adult ·
Show More